package com.example.my_soft


import android.util.Log
import io.flutter.embedding.android.FlutterActivity
import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.plugin.common.BasicMessageChannel;
import io.flutter.plugin.common.StringCodec;

class MainActivity : FlutterActivity() {
        private val applist = "https://gitee.com/li0shang/softwareAPI/raw/master/appList.json";

        override fun configureFlutterEngine(flutterEngine: FlutterEngine) {
            super.configureFlutterEngine(flutterEngine)
//        val applist = "xxxxx";
            val channel = BasicMessageChannel(flutterEngine.dartExecutor.binaryMessenger,"applist_channel",StringCodec.INSTANCE)
            channel.setMessageHandler { message, reply ->
                Log.e("message", "安卓端接收参数: $message", );
                reply.reply(applist);
            }

            channel.send("安卓端发送参数：${applist}")
        }
}
